<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

    <head>

        <title>Paster-by</title>

	<link rel="stylesheet" href="style.css" type="text/css" media="screen" /> 
    <link type="text/css" rel="Stylesheet" href="styles/shThemeDefault.css"/>
	<link href="styles/shCore.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
    
    </head>

    <body>
    <script type="text/javascript" src="scripts/shCore.js"></script>

        <?php

            require ( "database.php" );

            require ( "xmlparser.php" );

            database_connect ();

            $array = database_retrieve ( $_REQUEST['link'] );

            $text = str_replace("<","&lt;",$array ['Text']);
			
			switch($array['Language'])
			{
				case 0: $lang='None';break;
				case 1: $lang='C/C++';echo ( "<script type='text/javascript' src='scripts/shBrushCpp.js'></script>" );break;
				case 2: $lang='delphi';echo ( "<script type='text/javascript' src='scripts/shBrushDelphi.js'></script>");break;
				case 3: $lang='shell';echo ( "<script type='text/javascript' src='scripts/shBrushBash.js'></script>");break;
				case 4: $lang='CSharp';echo ( "<script type='text/javascript' src='scripts/shBrushCSharp.js'></script>");break;
				case 5: $lang='Php';echo ( "<script type='text/javascript' src='scripts/shBrushPhp.js'></script>");break;
			}
        ?>

	<div id="wrapper">
	<div id="header"> 

		<h1 class="vt-p">Pastebin</h1> 

		<div id="musicplayer" style="position:fixed;top:0px;right:20%"></div> 

	</div>

	<div id="page" class="corners" align="left">

        <div>

	<font size="4 px">Paste <?php
						
						echo $array['Title'];

                        print ( " in " . $lang);

                        print ( " at " . $array['Date'] ); 

                    ?>

		    </font>

  </div>

		<div style="margin:20px 0;" align="left"><img src="../line.png"></div> 

                           <?php

                                echo ( "<pre");
								switch($array['Language'])
								{
									case 0:break;
									case 1:echo (" class='brush: cpp'");break;
									case 2:echo (" class='brush: pas'");break;
									case 3:echo (" class='brush: shell'");break;
									case 4:echo (" class='brush: csharp'");break;
									case 5:echo (" class='brush: php'");break;
								}
								echo ( ">\n" . $text . "\n</pre>" );
						  ?>
         <div style="margin:20px 0;" align="left"><img src="../line.png"></div> 
        <div align="left"> 
           <table class="recent">
        <thead><tr> 
          <!-- <th class="recentnum">#</th> --> 
          <th class="recenttitle">Title</th> 
          <th class="recenttype">Type</th> 
          <th class="recentdate">Date</th> 
        </tr></thead>
        <tbody>  
        	<?php
			$xml_parser = new CXmlParser;
			$rules = $xml_parser->parse ( "rules.xml" );
			$num=database_entries ();
			for($i=0;$i<$num;$i++)
			{
				 $array= database_retrieve_id ( $i );	
				 if ($array['Public']==1)
					 continue;
				 echo ( "<tr> \n");
				 //echo ( "<td class='recentnum'>" . $i . "</td> \n");
				 echo ( "<td  class='recenttitle'><a href=" . $array['Link'] . ">" . $array['Title'] . "</a></td>\n");
				 echo ( "<td class='recenttype'>".$rules ['RULE'][$array['Language']]['attributes']['NAME']."</td>\n");
				 echo ( "<td class='recentdate'>" . $array['Date']);
				 
			}
        ?>
        </tbody> 
     </table>
     </div>
        <div align="center"><a href="index.php">&gt;back&lt;</a></div>
            <div align="right">
      Code by <a href="http://sourceforge.net/projects/openpastebin/" target="_blank">OpenPaste</a>
      Edit by <a href="http://www.fanhe.org/" target="_blank">fanzeyi</a>
      Design by <a href="http://anegie.com/" target="_blank">Kevin Deng</a>
  </div>
	</div>
     <div>&nbsp;<br />&nbsp;<br /></div>
	</div>
    <script type="text/javascript">
   	  SyntaxHighlighter.all()
    </script>
    </body>

</html>

